package com.ziyueyuwen.xiniao.enums;

import java.util.*;

/**
 * @author wancheng  on 2019/1/3.
 */
public enum  GradeEnum {
    /**
     *
     */
    GRADE_ONE("一年级",1),
    GRADE_TWO("二年级",2),
    GRADE_THREE("三年级",3),
    GRADE_FOUR("四年级",4),
    GRADE_FOUR_FIVE("新四五年级",5),
    GRADE_FIVE("五年级",6),
    GRADE_SIX("六年级",7);

    private String description;

    private Integer order;

    public static List<GradeEnum> getAll(){
        return Arrays.asList(GradeEnum.values());
    }
    public static List<Map<String,Object>> getAllMap(){
         List<Map<String,Object>> res = new ArrayList<>();
        for (GradeEnum e:GradeEnum.values()) {
            Map<String,Object> map = new HashMap<>();
            map.put("name",e.getDescription());
            map.put("value",e);
            res.add(map);
        }
        return res;
    }

    GradeEnum(String description, Integer order) {
        this.description = description;
        this.order = order;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getOrder() {
        return order;
    }

    public void setOrder(Integer order) {
        this.order = order;
    }
}
